默认配置

// postcss.config.js
module.exports = {
  plugins: [
    require('autoprefixer')({ overrideBrowserslist: ['iOS >= 7', 'Android >= 4.0'] })
  ]
};

自定义配置

在项目根目录加 postcss.config.js 文件,然后配置相关插件, 会覆盖默认配置

// ${app_root}/postcss.config.js
module.exports = {
  plugins: [
    require('autoprefixer')({ overrideBrowserslist: ['iOS >= 9', 'Android >= 4.4'] })
  ]
};

注意事项

如果构建时出现大量 browsers 错误,如下错误,browsers 改成 overrideBrowserslist
image.png

具体见:https://github.com/easy-team/easywebpack/issues/56


Author: sky
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source sky !
 Previous
plugins plugins
内置pluginplugin别名默认是否开启/开启环境npm-install-webpack-pluginnpm否webpack.DefinePlugindefine是webpack.NamedModulesPluginnameModule是/devwebpack.HashedModuleId...
2019-12-23 sky
Next 
常见问题 常见问题
Babel 快速升级问题为了更方便升级 Babel7, 同时尽量减少配置且无需安装 @babel 依赖,@easy-team 模式直接内置Babel 7 的相关依赖,只需要把 easywebpack 依赖模式改成 @easy-team/easywebpack 模式,如果代码中直接依赖了也请一并...
2019-12-23 sky